class CreateTeachings < ActiveRecord::Migration
  def self.up
    create_table :teachings do |t|
      t.column  :start, :date, :null => false
      t.column  :end, :date, :null => false
      t.column  :user_id, :integer, :null => false
      t.column  :project_id, :integer, :null => false
    end
    add_index :teachings, [:project_id, :user_id], :unique => true 
  end

  def self.down
    drop_table :teachings
  end
end
